//promise示例
const promise = new Promise((resolve,reject) => {
  //此处用于兑现承诺

  resolve(100) //成功回调

  reject(new Error('promise reject')) // 失败回调
})

promise.then(function(value){
  console.log('resolved',value)
},function(error){
  console.log(error)
})